package com.rw.test.restful;

import com.rw.engine.frequency.anno.FrequencyLimit;
import com.rw.test.vo.ResultVO;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.concurrent.TimeUnit;

/**
 * 频率测试
 */
@RestController
@RequestMapping("/RWdaze/PermissionTestController")
public class FrequencyTestController {
    @GetMapping("/trigger")
    @FrequencyLimit(requestsLimitTime = 10, minInterval = 1, minIntervalUtil = TimeUnit.SECONDS)
    public ResultVO<Long> frequencyTest() {
        return new ResultVO<>(0, "success", System.currentTimeMillis());
    }
}
